package net.googlecode.demenkov.task5.calculator;

import net.googlecode.demenkov.task5.model.Person;

/**
 * Class for creating salary calculator according to person type
 */
public class SalaryCalculatorFactory {
    /**
     * Get calculator for person type
     *
     * @param person the manager
     * @return calculator for person type
     */
    public static Calculator getCalculator(Person person) {
        if (person.getType().equals(Person.MANAGER) || person.getType().equals(Person.BOSS)) {
            return new ManagerSalaryCalculator();
        }
        return new EmployeeSalaryCalculator();
    }
}
